<div class="breadcrumbs" id="breadcrumbs">
	<ul class="breadcrumb">
		<li><i class="icon-home home-icon"></i><a href="#">Home</a></li>
		<li><a href="<?php Rights::getBaseUrl(); ?>">Access Role</a></li>
		<li><a href="<?php echo Yii::app()->createUrl('rights/assignment/view'); ?>">Assignments</a></li>
		<li><a class="current" href="#"><?php echo $model->getName(); ?></a></li>
		<li class="active">Widgets</li>
	</ul>
	<script type="text/javascript">
		try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
	</script>
</div>
<div class="col-xs-12">
<div class="page-content">
	<div class="page-header">
		
		<div class="clearfix">
			<div class="pull-left">
			<h1>
			<h1><?php echo Rights::t('core', 'Assignments for :username', array(
			':username'=>$model->getName()
			)); ?></h1>
		</h1>
			</div>
			<div class="pull-right">
				<div class="btn-toolbar inline middle no-margin">
					<div class="btn-group">
						<a title="Assignments" href="<?php echo Yii::app()->createUrl('rights/assignment/view'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Assignments</a>
						<a title="Permissions" href="<?php echo Yii::app()->createUrl('rights/authItem/permissions'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Permissions</a>
						<a title="Roles" href="<?php echo Yii::app()->createUrl('rights/authItem/roles'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Roles</a>
						<a title="Tasks" href="<?php echo Yii::app()->createUrl('rights/authItem/tasks'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Tasks</a>
						<a title="Operations" href="<?php echo Yii::app()->createUrl('rights/authItem/operations'); ?>" class="btn btn-sm "><i class="icon-file"></i>&nbsp;&nbsp;Operations</a>
					</div>
				</div>
			</div>
		</div>
	</div>

		<div class="col-xs-6">
			<div class="widget-box">
				<div class="widget-header header-color-blue">
					<h5 class="bigger lighter">
						<i class="icon-table"></i>
						Assignments for <?php echo $model->getName(); ?> table.
					</h5>
				</div>

				<div class="widget-body">
					<div class="widget-main no-padding">
						<?php $this->widget('bootstrap.widgets.TbGridView', array(
							'dataProvider'=>$dataProvider,
							'type'=>'striped bordered condensed',
							'template'=>'{items}',
							'hideHeader'=>true,
							'emptyText'=>Rights::t('core', 'This user has not been assigned any items.'),
							'htmlOptions'=>array('class'=>'grid-view user-assignment-table mini'),
							'columns'=>array(
								array(
									'name'=>'name',
									'header'=>Rights::t('core', 'Name'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'name-column'),
									'value'=>'$data->getNameText()',
								),
								array(
									'name'=>'type',
									'header'=>Rights::t('core', 'Type'),
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'type-column'),
									'value'=>'$data->getTypeText()',
								),
								array(
									'header'=>'&nbsp;',
									'type'=>'raw',
									'htmlOptions'=>array('class'=>'actions-column'),
									'value'=>'$data->getRevokeAssignmentLink()',
								),
							)
						)); ?>
					</div>
				</div>
			</div>
		</div><!-- /span -->

		<div class="col-xs-6">
			<div class="widget-box">
				<div class="widget-header header-color-blue">
					<h5 class="bigger lighter">
						<i class="icon-table"></i>
						Assignments item for <?php echo $model->getName(); ?> table.
					</h5>
				</div>

				<div class="widget-body">
					<div class="widget-main">
						<?php if( $formModel!==null ): ?>

								<div class="form">

									<?php $this->renderPartial('_form', array(
										'model'=>$formModel,
										'itemnameSelectOptions'=>$assignSelectOptions,
									)); ?>

								</div>

							<?php else: ?>

								<p class="info"><?php echo Rights::t('core', 'No assignments available to be assigned to this user.'); ?>

							<?php endif; ?>
					</div>
				</div>
			</div>
		</div><!-- /span -->
</div>
</div>
<script>
	$('.id-5').addClass('active');	
	$('.id-5').addClass('open');	
	$('.id-16').addClass('open');	
	$('.id-18').addClass('active');	
</script>
